package com.lemontree.spring3.day02;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by lemontree on 2017/7/27.
 */
public class SpringTest {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        Stage stage = (Stage) applicationContext.getBean("stage");
        System.out.println(stage.getName());
        stage.setName("miss");
        Stage stage2 = (Stage) applicationContext.getBean("stage");
        System.out.println(stage2.getName());
        Auditorium auditorium = (Auditorium) applicationContext.getBean("auditorium");
        auditorium.inUse();
        Audit audit = (Audit) applicationContext.getBean("audit");
    }

    @Test
    public void test(){
        Stage stage = Stage.getInstance();
        System.out.println(stage.getName());
        stage.setName("miss");
        Stage stage1 = Stage.getInstance();
        System.out.println(stage1.getName());
    }
}
